package com.yu.waterstation.system.modules.system.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yu.waterstation.common.common.annotation.NeedPermission;
import com.yu.waterstation.common.common.exception.ServiceException;
import com.yu.waterstation.common.common.util.result.Result;
import com.yu.waterstation.system.modules.system.service.AdminLogService;
import com.yu.waterstation.common.entity.system.AdminLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * date 2020-12-11 17:19:19
 */
@Api(tags = "系统：管理员操作日志管理")
@RestController
@RequestMapping("system/adminLog")
public class AdminLogController {

    @Resource
    private AdminLogService adminLogService;

    @ApiOperation("分页查询")
    @NeedPermission("system:adminLog:list")
    @GetMapping("/page")
    public Result<Page<AdminLog>> getAdminLogByPage(
                    @ApiParam("页数") @RequestParam(defaultValue = "1") int pageNo,
                    @ApiParam("页面大小") @RequestParam(defaultValue = "10") int pageSize) throws ServiceException {
        return Result.ok(adminLogService.getAdminLogByPage(pageNo, pageSize));
    }

}
